import React from 'react';
import {Switch,Route,Redirect} from "react-router-dom"
import Login from "./pages/Login/Login"
import Lists from "./pages/Lists/Lists"
import Register from "./pages/Register/Register"
import Search from "./pages/Search/Search"
import Index from "./pages/Index/Index"
import Detail from "./pages/Detail/Detail"
import Coupon from "./pages/Coupon/Coupon"
import Orders from "./pages/Orders/Orders"
import PrivateRoute from "./utils/PrivateRoute"


const App = () => {
  return (
    <div>
        <Switch>
           <Route path="/Login" component={Login}></Route>
           <PrivateRoute path="/Lists/:id" component={Lists}></PrivateRoute>
           <PrivateRoute path="/Index" component={Index}></PrivateRoute>
           <Route path="/Register" component={Register}></Route>
           <PrivateRoute path="/Search" component={Search}></PrivateRoute>
           <PrivateRoute path="/Detail/:id" component={Detail}></PrivateRoute>
           <PrivateRoute path="/Coupon" component={Coupon}></PrivateRoute>
           <PrivateRoute path="/Orders" component={Orders}></PrivateRoute>
           
            {/* 重定向 */}
           <Redirect to="/Login"></Redirect>
        </Switch>
    </div>
  );
}

export default App;
